package org.linys.service.system;

import java.util.List;

import org.linys.dao.system.OperatorDAO;
import org.linys.model.system.Operator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class OperatorServ {
	private OperatorDAO operatorDAO;
	
	public OperatorDAO getOperatorDAO() {
		return operatorDAO;
	}
	@Autowired
	public void setOperatorDAO(OperatorDAO operatorDAO) {
		this.operatorDAO = operatorDAO;
	}

	public int save(Operator operator){
		
		return operatorDAO.save(operator);
	}
	public List<Operator> list(Operator operator,Integer start, Integer end) {
		return operatorDAO.list(operator,start,end);
	}
	public int deleteByID(Integer id) {
		return operatorDAO.deleteByID(id);
	}
	public int update(Operator operator) {
		return operatorDAO.update(operator);
	}
	public Operator login(Operator operator) {
		if(operatorDAO==null){
			operatorDAO = new OperatorDAO();
		}
		return operatorDAO.login(operator);
	}
	
	public int count(Operator operator){
		return operatorDAO.count(operator);
	}
	public int changeWindowStyle(Operator operator) {
		return operatorDAO.changeWindowStyle(operator);
	}
	public int updatePassword(Operator operator) {
		return operatorDAO.updatePassword(operator);
	}
	public int validatePassword(Operator operator) {
		return operatorDAO.validatePassword(operator);
	}
	

}
